package club.fuwenhao.controller;

import com.alibaba.fastjson.JSON;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/fwh")
public class TestController {

    @PostMapping("/test")
    public ResEntity test(@RequestBody UserTest request) {
        System.out.println(JSON.toJSONString(request));
        List<UserTest> testList = new ArrayList<>();
        testList.add(request);
        return new ResEntity().setCode("0").setMessage("ok").setData(testList);
    }
}
